alter table jms_dim.dim_tmsnew_vehicle_line set tblproperties ('external.table.purge'='true');
drop table if exists jms_dim.dim_tmsnew_vehicle_line;
create external table if not exists  jms_dim.dim_tmsnew_vehicle_line(
    id                          bigint          comment'主键'
   ,code                        string          comment'车线编码'
   ,name                        string          comment'车线名称'
   ,vehicleline_type            bigint          comment'1总部招标；2加盟商供车；3临时车线；4网点自跑'
   ,shifts                      bigint          comment'班次'
   ,transport_type              string          comment'运力类型'
   ,grade                       bigint          comment'等级'
   ,start_id                    bigint          comment'始发网点ID'
   ,start_code                  string          comment'始发网点编号'
   ,start_name                  string          comment'始发网点名称'
   ,end_id                      bigint          comment'目的网点ID'
   ,end_code                    string          comment'目的网点编号'
   ,end_name                    string          comment'目的网点名称'
   ,operation_model             bigint          comment'运行模式'
   ,effective_date              timestamp       comment'生效时间'
   ,expiration_date             timestamp       comment'失效时间'
   ,working_day                 string          comment'发出工作日'
   ,vehicle_groupid             bigint          comment'规划车型组ID'
   ,vehicle_typegroup           string          comment'规划车型'
   ,cnt                         bigint          comment'途径地数量'
   ,car_cnt                     bigint          comment'车辆数'
   ,mileage                     double          comment'系统里程(KM)'
   ,total_runtime               bigint          comment'总运行时间(MIN)'
   ,total_intransittime         bigint          comment'总在途时间(MIN)'
   ,span_days                   bigint          comment'跨越天数'
   ,standard_speed              double          comment'标准时速(KM/H)'
   ,is_enable                   smallint        comment'是否启用:1启用,0不启用'
   ,planned_departure_time      string          comment'规划发车时间'
   ,planned_arrival_time        string          comment'规划到车时间'
   ,remark                      string          comment'备注'
   ,product_type                string          comment'产品类型'
   ,create_by                   bigint          comment'创建人ID'
   ,create_by_name              string          comment'创建人姓名'
   ,create_time                 timestamp       comment'创建时间'
   ,update_by                   bigint          comment'更新人ID'
   ,update_by_name              string          comment'更新人姓名'
   ,update_time                 timestamp       comment'更新时间'
   ,is_stop                     smallint        comment'是否经停：0：否，1：是'
   ,is_assist_line              tinyint         comment'是否辅线（1是，2否)'
   ,end_regional_desc           string          comment'目的大区'
   ,start_regional_desc         string          comment'始发大区'
   ,end_attribution_area        string          comment'目的所属代理区'
   ,start_attribution_area      string          comment'始发所属代理区'
   ,end_simple_name             string          comment'目的地简称'
   ,start_simple_name           string          comment'始发地简称'
   ,promotion                   tinyint         comment'是否促销：1:是，2：否'
   ,line_name                   string          comment'线路名称（不带班次）'
   ,billing_way                 tinyint         comment'计费方式（1：整车计重、2：零担计重、3：按趟计费'
   ,line_enable_time            timestamp       comment'线路启用时间'
   ,main_id                     bigint          comment'主线路编码'
   ,enable_type                 tinyint         comment'禁用类型0-暂无操作1-手动2-自动'
   ,give_shifts_id              string          comment'最早散货班次id'
   ,give_shifts_name            string          comment'最早散货班次名称'
   ,join_time                   string          comment'衔接时长'
   ,give_shifts_time            string          comment'最早班次时间'
   ,has_out                     smallint        comment'是否兜底1-是2-否'
   ,operate_time                int             comment'操作时长分钟'
   ,is_ballast                  tinyint         comment'是否空放1-是2-否'
   ,send_collect                tinyint         comment'既发有屯1-是2-否'
) comment '运力平台-车线表'
stored as parquet
location '/dw/hive/jms_dim.db/external/dim_tmsnew_vehicle_line'
tblproperties (
'discover.partitions' = 'false',
'parquet.column.index.access' = 'true'
);
